The present invention belongs to a technical field of image processing for detecting a particular region such as a red eye and a golden eye in a face region in an image caught on a photographic film or an image taken by a digital camera. In particular, the present invention relates to a method and apparatus for detecting a particular region which enable high-speed detection of a red eye, a golden eye or the like from an image, and a program for implementing such a particular-region detection method.
There has recently been put to practical use a digital photoprinter for photoelectrically reading an image recorded on a film, converting the read image into a digital signal, subsequently executing various image processing operations to convert the digital signal into image data for recording, executing photosensitive material exposure by a recording light modulated in accordance with the image data, and outputting the image as a print.
In the digital photoprinter, the image caught on the film is photoelectrically read, the image is converted into the digital image data, and the image processing and the photosensitive material exposure are executed. Accordingly, prints can be created from not only the image caught on the film but also the image (image data) taken by the digital camera or the like.
With recent popularization of a personal computer (PC), a digital camera, and an inexpensive color printer such as an ink-jet printer, many users load images taken by the digital cameras into their PC's, carry out image processing, and output the images by using the printers.
In addition, there has recently been put to practical use a printer for directly reading image data from a storage medium storing an image taken by a digital camera, executing predetermined image processing, and outputting a print (hard copy). Examples of the storage medium include a magneto-optical recording medium (MO or the like), a compact semiconductor memory medium (Smart Media™, Compact Flash™ or the like), a magnetic recording medium (flexible disk or the like), and an optical disk (CD, CD-R, or the like).
Incidentally, in an image that contains a person, such as a portrait, a most important factor to determine the image quality is a reproducibility of the person. Thus, a red-eye phenomenon in which eyes (pupils) of the person look red because of an influence of an electronic flash used during photographing is a serious problem.
In the conventional analog photoprinter that executes exposure directly through the film, red-eye correction is very difficult. However, in the case of the digital image processing of the digital photoprinter or the like, red eyes are detected by image processing (image analysis), and the red eyes can be corrected by correcting luminance or chroma of the red-eye regions.
As a method of detecting red eyes from an image when the red-eye correction process is carried out, for example, there is a method of detecting a face from an image by image data analysis, and then detecting eyes or red circles from the detected face. There have also been proposed various face detection methods used for the red-eye detection.
For example, JP 2000-137788 A discloses a method of improving accuracy of face detection as described below. A candidate region assumed to correspond to a face of a person is detected in an image, this candidate region is divided into a predetermined number of small blocks, a feature amount regarding frequency or amplitude of a change in density or luminance is obtained for each small block, and the feature amount is collated with a pattern indicating feature amount for each of small blocks which are obtained by dividing the pre-created region corresponding to the face of the person into a predetermined number. Accordingly, it is possible to improve the accuracy of the face detection by evaluating the degree of assurance that the face candidate region is a face region.
As another example, JP 2000-148980 A discloses a method of improving accuracy of face detection as follows: At first, a candidate region assumed to correspond to a face of a person is detected in an image, next, a region assumed to be a body is set by using the face candidate region as a reference when a density of the face candidate region is within a predetermined range, and then the degree of the assurance of a detection result of the face candidate region is evaluated based on the presence of a region in which a density difference between the set body region and the face candidate region is equal to or less than a predetermined value, or based on contrast of density or chroma between the face candidate region and the body candidate region.
Furthermore, JP 2000-149018 A discloses a method of detecting candidate regions assumed to correspond to faces of persons in an image by various detection analyses, obtaining a degree of overlapping of one among the detected candidate regions with another candidate region in the image, and evaluating a region of a higher degree of overlapping to be higher in the assurance of a face region. Accordingly, it is possible to improve the accuracy of the face detection.
The face detection requires accuracy, and various analyses are necessary. Thus, ordinarily, the face detection must be performed in high-resolution image data (so-called fine scan data in the case of image data read from a film, or taken-image data in the case of the digital camera) used for outputting a print or the like, and that causes a lot of time for detection.
Besides, there can be basically four directions of a face in a taken image depending on the orientation of a camera (horizontal and vertical positions and the like) during photographing. Here, if face directions are different, arraying directions of an eye, a nose, and the like naturally vary in vertical and horizontal directions in the image. Thus, to reliably detect the face, face detection must be performed in all the four directions in the image.
There are various face sizes in the image depending on object distances or the like. If face sizes are different in the image, a positional relation (distance) between an eye, a nose, and the like naturally varies in the image. Thus, to reliably detect the face, face detection must be performed corresponding to various face sizes.
As a result, the red-eye correction process takes much time because the red-eye detection, especially the face detection, becomes a rate-limiting factor. For example, in the case of the digital photoprinter, high-quality images of no red eyes can be stably output, but the long processing time is a major cause of reduction in productivity.
In this connection, an electronic flash possibly used during photographing may cause a golden-eye phenomenon in a taken image, in which the eyes (pupils) of an object person look, golden, as well as a red-eye phenomenon in which the eyes (pupils) look red. Although not so serious as the red-eye phenomenon, the golden-eye phenomenon is another problem in photographic images and the golden-eye correction involves difficulties similar to those of the red-eye correction.